<?php

// initialize the options before anything else
add_action( 'admin_init', 'prototype_theme_options', 1 );

// build the custom settings & update option tree
function prototype_theme_options() {

	// get a copy of the saved settings array
	$saved_settings = get_option( 'option_tree_settings', array() );

	// create a custom settings array that we pass to the option tree settings API class
	$custom_settings = array(

		'sections'	=> array(
			array(
				'title'	=> __( 'General',  TEXTDOMAIN ),
				'id'	=> 'general_section'
			)
		),
		'settings' => array(
			array(
				'label'		=> __( 'Breadcrumb', TEXTDOMAIN ),
				'id'		=> 'chk_breadcrumb',
				'type'		=> 'checkbox',
				'desc'		=> __( 'Breadcrumb Description', TEXTDOMAIN ),
				'choices'	=> array(
					array (
						'label'	=> __( 'Show Breadcrumb', TEXTDOMAIN ),
						'value'	=> true
					)
				),
				'std'		=> '',
				'rows'		=> '',
				'post_type'	=> '',
				'taxonomy'	=> '',
				'class'		=> '',
				'section'	=> 'general_section'
			),
			array(
				'label'		=> __( 'Font', TEXTDOMAIN ),
				'id'		=> 'sel_font',
				'type'		=> 'select',
				'desc'		=> __( 'Font Description', TEXTDOMAIN ),
				'choices'	=> array(
					array (
						'label'	=> __( '', TEXTDOMAIN ),
						'value'	=> ''
					),
					array (
						'label'	=> __( 'Roboto', TEXTDOMAIN ),
						'value'	=> 'Roboto'
					),
					array (
						'label'	=> __( 'THK2DJuly8', TEXTDOMAIN ),
						'value'	=> 'THK2DJuly8'
					)
				),
				'std'		=> '',
				'rows'		=> '',
				'post_type'	=> '',
				'taxonomy'	=> '',
				'class'		=> '',
				'section'	=> 'general_section'
			)
		)

	);

	// allow settings to be filtered before saving
	$custom_settings = apply_filters( 'option_tree_settings_args', $custom_settings );

	// settings are not the same update the database
	if ( $saved_settings !== $custom_settings ) {
		update_option( 'option_tree_settings', $custom_settings );
	}

}

?>